function onGuestBookLoad() {
    $.ajax({
        url:URL_HEAD_MESSAGES+"/list",
        type : "get",
        success: function(result) {
            const messageCount = result.data.length;
            if (messageCount > 0) {
                const builder = new StringBuilder();
                for (let i = 0; i < messageCount; i++) {
                    const message = result.data[i];
                    addMessageTableNewRow(message, builder);
                    console.log(message)
                }
            }
        },
        error:function(xhr, textStatus, errorThrown) {
            showError("导入留言管理失败", xhr, textStatus, errorThrown);
        }
    });
}

function addMessageTableNewRow(message,builder){
    builder.clear();
    builder.append("<tr><td class='first w4 c'>");
    builder.append(message.messageId)
    builder.append("<td><td class='w1 c'>");
    builder.append(message.userId);
    builder.append("</td><td class='w1 c'>")
    if (message.reply!==null){
        builder.append("已回复");
    }else {
        builder.append("未回复");
    }
    builder.append("</td><td class='w1 c'>");
    builder.append("<a href='guestbook-modify.html'>回复</a> <a href='javascript:Delete(1);'>删除</a></td>")
    builder.append("</tr>");
    $("#tbMessageManage tr:last").after(builder.toString());
}